home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Developer Toolbox 6.1
/
SGI Developer Toolbox 6.1 - Disc 4.iso
/
src
/
demos
/
GL
/
atlantis
/
shark.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-08-01
|
36KB
|
1,298 lines
/*
* Copyright 1992, 1993, 1994, Silicon Graphics, Inc.
* All Rights Reserved.
*
* This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
* the contents of this file may not be disclosed to third parties, copied or
* duplicated in any form, in whole or in part, without the prior written
* permission of Silicon Graphics, Inc.
*
* RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
* and Computer Software clause at DFARS 252.227-7013, and/or in similar or
* successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
* rights reserved under the Copyright Laws of the United States.
*/
#include "gl.h"
#include "math.h"
#include "atlantis.h"
#include "fish.h"
/* shark */
static float N001[3] = { 0.000000 ,1.000000 ,0.000000};
static float N002[3] = { 0.000077 ,-0.020611 ,0.999788};
static float N003[3] = { 0.961425 ,0.258729 ,-0.093390};
static float N004[3] = { 0.510811 ,-0.769633 ,-0.383063};
static float N005[3] = { 0.400123 ,0.855734 ,-0.328055};
static float N006[3] = { -0.770715 ,0.610204 ,-0.183440};
static float N007[3] = { -0.915597 ,-0.373345 ,-0.149316};
static float N008[3] = { -0.972788 ,0.208921 ,-0.100179};
static float N009[3] = { -0.939713 ,-0.312268 ,-0.139383};
static float N010[3] = { -0.624138 ,-0.741047 ,-0.247589};
static float N011[3] = { 0.591434 ,-0.768401 ,-0.244471};
static float N012[3] = { 0.935152 ,-0.328495 ,-0.132598};
static float N013[3] = { 0.997102 ,0.074243 ,-0.016593};
static float N014[3] = { 0.969995 ,0.241712 ,-0.026186};
static float N015[3] = { 0.844539 ,0.502628 ,-0.184714};
static float N016[3] = { -0.906608 ,0.386308 ,-0.169787};
static float N017[3] = { -0.970016 ,0.241698 ,-0.025516};
static float N018[3] = { -0.998652 ,0.050493 ,-0.012045};
static float N019[3] = { -0.942685 ,-0.333051 ,-0.020556};
static float N020[3] = { -0.660944 ,-0.750276 ,0.015480};
static float N021[3] = { 0.503549 ,-0.862908 ,-0.042749};
static float N022[3] = { 0.953202 ,-0.302092 ,-0.012089};
static float N023[3] = { 0.998738 ,0.023574 ,0.044344};
static float N024[3] = { 0.979297 ,0.193272 ,0.060202};
static float N025[3] = { 0.798300 ,0.464885 ,0.382883};
static float N026[3] = { -0.756590 ,0.452403 ,0.472126};
static float N027[3] = { -0.953855 ,0.293003 ,0.065651};
static float N028[3] = { -0.998033 ,0.040292 ,0.048028};
static float N029[3] = { -0.977079 ,-0.204288 ,0.059858};
static float N030[3] = { -0.729117 ,-0.675304 ,0.111140};
static float N031[3] = { 0.598361 ,-0.792753 ,0.116221};
static float N032[3] = { 0.965192 ,-0.252991 ,0.066332};
static float N033[3] = { 0.998201 ,-0.002790 ,0.059892};
static float N034[3] = { 0.978657 ,0.193135 ,0.070207};
static float N035[3] = { 0.718815 ,0.680392 ,0.142733};
static float N036[3] = { -0.383096 ,0.906212 ,0.178936};
static float N037[3] = { -0.952831 ,0.292590 ,0.080647};
static float N038[3] = { -0.997680 ,0.032417 ,0.059861};
static float N039[3] = { -0.982629 ,-0.169881 ,0.074700};
static float N040[3] = { -0.695424 ,-0.703466 ,0.146700};
static float N041[3] = { 0.359323 ,-0.915531 ,0.180805};
static float N042[3] = { 0.943356 ,-0.319387 ,0.089842};
static float N043[3] = { 0.998272 ,-0.032435 ,0.048993};
static float N044[3] = { 0.978997 ,0.193205 ,0.065084};
static float N045[3] = { 0.872144 ,0.470094 ,-0.135565};
static float N046[3] = { -0.664282 ,0.737945 ,-0.119027};
static float N047[3] = { -0.954508 ,0.288570 ,0.075107};
static float N048[3] = { -0.998273 ,0.032406 ,0.048993};
static float N049[3] = { -0.979908 ,-0.193579 ,0.048038};
static float N050[3] = { -0.858736 ,-0.507202 ,-0.072938};
static float N051[3] = { 0.643545 ,-0.763887 ,-0.048237};
static float N052[3] = { 0.955580 ,-0.288954 ,0.058068};
static float N053[3] = { 0.000000 ,1.000000 ,0.000000};
static float N054[3] = { 0.000000 ,1.000000 ,0.000000};
static float N055[3] = { 0.000000 ,1.000000 ,0.000000};
static float N056[3] = { 0.000000 ,1.000000 ,0.000000};
static float N057[3] = { 0.000000 ,1.000000 ,0.000000};
static float N058[3] = { 0.000050 ,0.793007 ,-0.609213};
static float N059[3] = { 0.913510 ,0.235418 ,-0.331779};
static float N060[3] = { -0.807970 ,0.495000 ,-0.319625};
static float N061[3] = { 0.000000 ,0.784687 ,-0.619892};
static float N062[3] = { 0.000000 ,-1.000000 ,0.000000};
static float N063[3] = { 0.000000 ,1.000000 ,0.000000};
static float N064[3] = { 0.000000 ,1.000000 ,0.000000};
static float N065[3] = { 0.000000 ,1.000000 ,0.000000};
static float N066[3] = { -0.055784 ,0.257059 ,0.964784};
static float N067[3] = { 0.000000 ,1.000000 ,0.000000};
static float N068[3] = { 0.000000 ,1.000000 ,0.000000};
static float N069[3] = { -0.000505 ,-0.929775 ,-0.368127};
static float N070[3] = { 0.000000 ,1.000000 ,0.000000};
static float N071[3] = { -0.987102 ,0.131723 ,-0.090984};
static float N072[3] = { -0.987102 ,0.131723 ,-0.090984};
static float N073[3] = { -0.987102 ,0.131723 ,-0.090984};
static float N074[3] = { 0.000000 ,1.000000 ,0.000000};
static float N075[3] = { 0.000000 ,1.000000 ,0.000000};
static float N076[3] = { 0.000000 ,1.000000 ,0.000000};
static float N077[3] = { 0.995210 ,0.071962 ,-0.066168};
static float N078[3] = { 0.995210 ,0.071962 ,-0.066168};
static float N079[3] = { 0.995210 ,0.071962 ,-0.066168};
static float N080[3] = { 0.000000 ,1.000000 ,0.000000};
static float N081[3] = { 0.000000 ,1.000000 ,0.000000};
static float N082[3] = { 0.000000 ,1.000000 ,0.000000};
static float P001[3] = { 0.00, 0.00, 0.00 };
static float P002[3] = { 0.00, -36.59, 5687.72 };
static float P003[3] = { 90.00, 114.73, 724.38 };
static float P004[3] = { 58.24, -146.84, 262.35 };
static float P005[3] = { 27.81, 231.52, 510.43 };
static float P006[3] = { -27.81, 230.43, 509.76 };
static float P007[3] = { -46.09, -146.83, 265.84 };
static float P008[3] = { -90.00, 103.84, 718.53 };
static float P009[3] = { -131.10, -165.92, 834.85 };
static float P010[3] = { -27.81, -285.31, 500.00 };
static float P011[3] = { 27.81, -285.32, 500.00 };
static float P012[3] = { 147.96, -170.89, 845.50 };
static float P013[3] = { 180.00, 0.00, 2000.00 };
static float P014[3] = { 145.62, 352.67, 2000.00 };
static float P015[3] = { 55.62, 570.63, 2000.00 };
static float P016[3] = { -55.62, 570.64, 2000.00 };
static float P017[3] = { -145.62, 352.68, 2000.00 };
static float P018[3] = { -180.00, 0.01, 2000.00 };
static float P019[3] = { -178.20, -352.66, 2001.61 };
static float P020[3] = { -55.63, -570.63, 2000.00 };
static float P021[3] = { 55.62, -570.64, 2000.00 };
static float P022[3] = { 179.91, -352.69, 1998.39 };
static float P023[3] = { 150.00, 0.00, 3000.00 };
static float P024[3] = { 121.35, 293.89, 3000.00 };
static float P025[3] = { 46.35, 502.93, 2883.09 };
static float P026[3] = { -46.35, 497.45, 2877.24 };
static float P027[3] = { -121.35, 293.90, 3000.00 };
static float P028[3] = { -150.00, 0.00, 3000.00 };
static float P029[3] = { -152.21, -304.84, 2858.68 };
static float P030[3] = { -46.36, -475.52, 3000.00 };
static float P031[3] = { 46.35, -475.53, 3000.00 };
static float P032[3] = { 155.64, -304.87, 2863.50 };
static float P033[3] = { 90.00, 0.00, 4000.00 };
static float P034[3] = { 72.81, 176.33, 4000.00 };
static float P035[3] = { 27.81, 285.32, 4000.00 };
static float P036[3] = { -27.81, 285.32, 4000.00 };
static float P037[3] = { -72.81, 176.34, 4000.00 };
static float P038[3] = { -90.00, 0.00, 4000.00 };
static float P039[3] = { -72.81, -176.33, 4000.00 };
static float P040[3] = { -27.81, -285.31, 4000.00 };
static float P041[3] = { 27.81, -285.32, 4000.00 };
static float P042[3] = { 72.81, -176.34, 4000.00 };
static float P043[3] = { 30.00, 0.00, 5000.00 };
static float P044[3] = { 24.27, 58.78, 5000.00 };
static float P045[3] = { 9.27, 95.11, 5000.00 };
static float P046[3] = { -9.27, 95.11, 5000.00 };
static float P047[3] = { -24.27, 58.78, 5000.00 };
static float P048[3] = { -30.00, 0.00, 5000.00 };
static float P049[3] = { -24.27, -58.78, 5000.00 };
static float P050[3] = { -9.27, -95.10, 5000.00 };
static float P051[3] = { 9.27, -95.11, 5000.00 };
static float P052[3] = { 24.27, -58.78, 5000.00 };
static float P053[3] = { 0.00, 0.00, 0.00 };
static float P054[3] = { 0.00, 0.00, 0.00 };
static float P055[3] = { 0.00, 0.00, 0.00 };
static float P056[3] = { 0.00, 0.00, 0.00 };
static float P057[3] = { 0.00, 0.00, 0.00 };
static float P058[3] = { 0.00, 1212.72, 2703.08 };
static float P059[3] = { 50.36, 0.00, 108.14 };
static float P060[3] = { -22.18, 0.00, 108.14 };
static float P061[3] = { 0.00, 1181.61, 6344.65 };
static float P062[3] = { 516.45, -887.08, 2535.45 };
static float P063[3] = { -545.69, -879.31, 2555.63 };
static float P064[3] = { 618.89, -1005.64, 2988.32 };
static float P065[3] = { -635.37, -1014.79, 2938.68 };
static float P066[3] = { 0.00, 1374.43, 3064.18 };
static float P067[3] = { 158.49, -11.89, 1401.56 };
static float P068[3] = { -132.08, -17.90, 1394.31 };
static float P069[3] = { 0.00, -418.25, 5765.04 };
static float P070[3] = { 0.00, 1266.91, 6629.60 };
static float P071[3] = { -139.12, -124.96, 997.98 };
static float P072[3] = { -139.24, -110.18, 1020.68 };
static float P073[3] = { -137.33, -94.52, 1022.63 };
static float P074[3] = { -137.03, -79.91, 996.89 };
static float P075[3] = { -135.21, -91.48, 969.14 };
static float P076[3] = { -135.39, -110.87, 968.76 };
static float P077[3] = { 150.23, -78.44, 995.53 };
static float P078[3] = { 152.79, -92.76, 1018.46 };
static float P079[3] = { 154.19, -110.20, 1020.55 };
static float P080[3] = { 151.33, -124.15, 993.77 };
static float P081[3] = { 150.49, -111.19, 969.86 };
static float P082[3] = { 150.79, -92.41, 969.70 };
static float iP002[3] = { 0.00, -36.59, 5687.72 };
static float iP004[3] = { 58.24, -146.84, 262.35 };
static float iP007[3] = { -46.09, -146.83, 265.84 };
static float iP010[3] = { -27.81, -285.31, 500.00 };
static float iP011[3] = { 27.81, -285.32, 500.00 };
static float iP023[3] = { 150.00, 0.00, 3000.00 };
static float iP024[3] = { 121.35, 293.89, 3000.00 };
static float iP025[3] = { 46.35, 502.93, 2883.09 };
static float iP026[3] = { -46.35, 497.45, 2877.24 };
static float iP027[3] = { -121.35, 293.90, 3000.00 };
static float iP028[3] = { -150.00, 0.00, 3000.00 };
static float iP029[3] = { -121.35, -304.84, 2853.86 };
static float iP030[3] = { -46.36, -475.52, 3000.00 };
static float iP031[3] = { 46.35, -475.53, 3000.00 };
static float iP032[3] = { 121.35, -304.87, 2853.86 };
static float iP033[3] = { 90.00, 0.00, 4000.00 };
static float iP034[3] = { 72.81, 176.33, 4000.00 };
static float iP035[3] = { 27.81, 285.32, 4000.00 };
static float iP036[3] = { -27.81, 285.32, 4000.00 };
static float iP037[3] = { -72.81, 176.34, 4000.00 };
static float iP038[3] = { -90.00, 0.00, 4000.00 };
static float iP039[3] = { -72.81, -176.33, 4000.00 };
static float iP040[3] = { -27.81, -285.31, 4000.00 };
static float iP041[3] = { 27.81, -285.32, 4000.00 };
static float iP042[3] = { 72.81, -176.34, 4000.00 };
static float iP043[3] = { 30.00, 0.00, 5000.00 };
static float iP044[3] = { 24.27, 58.78, 5000.00 };
static float iP045[3] = { 9.27, 95.11, 5000.00 };
static float iP046[3] = { -9.27, 95.11, 5000.00 };
static float iP047[3] = { -24.27, 58.78, 5000.00 };
static float iP048[3] = { -30.00, 0.00, 5000.00 };
static float iP049[3] = { -24.27, -58.78, 5000.00 };
static float iP050[3] = { -9.27, -95.10, 5000.00 };
static float iP051[3] = { 9.27, -95.11, 5000.00 };
static float iP052[3] = { 24.27, -58.78, 5000.00 };
static float iP053[3] = { 0.00, 0.00, 0.00 };
static float iP061[3] = { 0.00, 1181.61, 6344.65 };
static float iP069[3] = { 0.00, -418.25, 5765.04 };
static float iP070[3] = { 0.00, 1266.91, 6629.60 };
fish001()
{
bgnpolygon();
n3f( N005);
v3f( P005);
n3f( N059);
v3f( P059);
n3f( N060);
v3f( P060);
n3f( N006);
v3f( P006);
endpolygon();
bgnpolygon();
n3f( N015);
v3f( P015);
n3f( N005);
v3f( P005);
n3f( N006);
v3f( P006);
n3f( N016);
v3f( P016);
endpolygon();
bgnpolygon();
n3f( N006);
v3f( P006);
n3f( N060);
v3f( P060);
n3f( N008);
v3f( P008);
endpolygon();
bgnpolygon();
n3f( N016);
v3f( P016);
n3f( N006);
v3f( P006);
n3f( N008);
v3f( P008);
endpolygon();
bgnpolygon();
n3f( N016);
v3f( P016);
n3f( N008);
v3f( P008);
n3f( N017);
v3f( P017);
endpolygon();
bgnpolygon();
n3f( N017);
v3f( P017);
n3f( N008);
v3f( P008);
n3f( N018);
v3f( P018);
endpolygon();
bgnpolygon();
n3f( N008);
v3f( P008);
n3f( N009);
v3f( P009);
n3f( N018);
v3f( P018);
endpolygon();
bgnpolygon();
n3f( N008);
v3f( P008);
n3f( N060);
v3f( P060);
n3f( N009);
v3f( P009);
endpolygon();
bgnpolygon();
n3f( N007);
v3f( P007);
n3f( N010);
v3f( P010);
n3f( N009);
v3f( P009);
endpolygon();
bgnpolygon();
n3f( N009);
v3f( P009);
n3f( N019);
v3f( P019);
n3f( N018);
v3f( P018);
endpolygon();
bgnpolygon();
n3f( N009);
v3f( P009);
n3f( N010);
v3f( P010);
n3f( N019);
v3f( P019);
endpolygon();
bgnpolygon();
n3f( N010);
v3f( P010);
n3f( N020);
v3f( P020);
n3f( N019);
v3f( P019);
endpolygon();
bgnpolygon();
n3f( N010);
v3f( P010);
n3f( N011);
v3f( P011);
n3f( N021);
v3f( P021);
n3f( N020);
v3f( P020);
endpolygon();
bgnpolygon();
n3f( N004);
v3f( P004);
n3f( N011);
v3f( P011);
n3f( N010);
v3f( P010);
n3f( N007);
v3f( P007);
endpolygon();
bgnpolygon();
n3f( N004);
v3f( P004);
n3f( N012);
v3f( P012);
n3f( N011);
v3f( P011);
endpolygon();
bgnpolygon();
n3f( N012);
v3f( P012);
n3f( N022);
v3f( P022);
n3f( N011);
v3f( P011);
endpolygon();
bgnpolygon();
n3f( N011);
v3f( P011);
n3f( N022);
v3f( P022);
n3f( N021);
v3f( P021);
endpolygon();
bgnpolygon();
n3f( N059);
v3f( P059);
n3f( N005);
v3f( P005);
n3f( N015);
v3f( P015);
endpolygon();
bgnpolygon();
n3f( N015);
v3f( P015);
n3f( N014);
v3f( P014);
n3f( N003);
v3f( P003);
endpolygon();
bgnpolygon();
n3f( N015);
v3f( P015);
n3f( N003);
v3f( P003);
n3f( N059);
v3f( P059);
endpolygon();
bgnpolygon();
n3f( N014);
v3f( P014);
n3f( N013);
v3f( P013);
n3f( N003);
v3f( P003);
endpolygon();
bgnpolygon();
n3f( N003);
v3f( P003);
n3f( N012);
v3f( P012);
n3f( N059);
v3f( P059);
endpolygon();
bgnpolygon();
n3f( N013);
v3f( P013);
n3f( N012);
v3f( P012);
n3f( N003);
v3f( P003);
endpolygon();
bgnpolygon();
n3f( N013);
v3f( P013);
n3f( N022);
v3f( P022);
n3f( N012);
v3f( P012);
endpolygon();
lmbind(LMODEL,0);
cpack(0);
bgnpolygon();
v3f( P071);
v3f( P072);
v3f( P073);
v3f( P074);
v3f( P075);
v3f( P076);
endpolygon();
bgnpolygon();
v3f( P077);
v3f( P078);
v3f( P079);
v3f( P080);
v3f( P081);
v3f( P082);
endpolygon();
lmbind(LMODEL,1);
}
fish002()
{
bgnpolygon();
n3f( N013);
v3f( P013);
n3f( N014);
v3f( P014);
n3f( N024);
v3f( P024);
n3f( N023);
v3f( P023);
endpolygon();
bgnpolygon();
n3f( N014);
v3f( P014);
n3f( N015);
v3f( P015);
n3f( N025);
v3f( P025);
n3f( N024);
v3f( P024);
endpolygon();
bgnpolygon();
n3f( N016);
v3f( P016);
n3f( N017);
v3f( P017);
n3f( N027);
v3f( P027);
n3f( N026);
v3f( P026);
endpolygon();
bgnpolygon();
n3f( N017);
v3f( P017);
n3f( N018);
v3f( P018);
n3f( N028);
v3f( P028);
n3f( N027);
v3f( P027);
endpolygon();
bgnpolygon();
n3f( N020);
v3f( P020);
n3f( N021);
v3f( P021);
n3f( N031);
v3f( P031);
n3f( N030);
v3f( P030);
endpolygon();
bgnpolygon();
n3f( N013);
v3f( P013);
n3f( N023);
v3f( P023);
n3f( N022);
v3f( P022);
endpolygon();
bgnpolygon();
n3f( N022);
v3f( P022);
n3f( N023);
v3f( P023);
n3f( N032);
v3f( P032);
endpolygon();
bgnpolygon();
n3f( N022);
v3f( P022);
n3f( N032);
v3f( P032);
n3f( N031);
v3f( P031);
endpolygon();
bgnpolygon();
n3f( N022);
v3f( P022);
n3f( N031);
v3f( P031);
n3f( N021);
v3f( P021);
endpolygon();
bgnpolygon();
n3f( N018);
v3f( P018);
n3f( N019);
v3f( P019);
n3f( N029);
v3f( P029);
endpolygon();
bgnpolygon();
n3f( N018);
v3f( P018);
n3f( N029);
v3f( P029);
n3f( N028);
v3f( P028);
endpolygon();
bgnpolygon();
n3f( N019);
v3f( P019);
n3f( N020);
v3f( P020);
n3f( N030);
v3f( P030);
endpolygon();
bgnpolygon();
n3f( N019);
v3f( P019);
n3f( N030);
v3f( P030);
n3f( N029);
v3f( P029);
endpolygon();
}
fish003()
{
bgnpolygon();
n3f( N032);
v3f( P032);
n3f( N023);
v3f( P023);
n3f( N033);
v3f( P033);
n3f( N042);
v3f( P042);
endpolygon();
bgnpolygon();
n3f( N031);
v3f( P031);
n3f( N032);
v3f( P032);
n3f( N042);
v3f( P042);
n3f( N041);
v3f( P041);
endpolygon();
bgnpolygon();
n3f( N023);
v3f( P023);
n3f( N024);
v3f( P024);
n3f( N034);
v3f( P034);
n3f( N033);
v3f( P033);
endpolygon();
bgnpolygon();
n3f( N024);
v3f( P024);
n3f( N025);
v3f( P025);
n3f( N035);
v3f( P035);
n3f( N034);
v3f( P034);
endpolygon();
bgnpolygon();
n3f( N030);
v3f( P030);
n3f( N031);
v3f( P031);
n3f( N041);
v3f( P041);
n3f( N040);
v3f( P040);
endpolygon();
bgnpolygon();
n3f( N025);
v3f( P025);
n3f( N026);
v3f( P026);
n3f( N036);
v3f( P036);
n3f( N035);
v3f( P035);
endpolygon();
bgnpolygon();
n3f( N026);
v3f( P026);
n3f( N027);
v3f( P027);
n3f( N037);
v3f( P037);
n3f( N036);
v3f( P036);
endpolygon();
bgnpolygon();
n3f( N027);
v3f( P027);
n3f( N028);
v3f( P028);
n3f( N038);
v3f( P038);
n3f( N037);
v3f( P037);
endpolygon();
bgnpolygon();
n3f( N028);
v3f( P028);
n3f( N029);
v3f( P029);
n3f( N039);
v3f( P039);
n3f( N038);
v3f( P038);
endpolygon();
bgnpolygon();
n3f( N029);
v3f( P029);
n3f( N030);
v3f( P030);
n3f( N040);
v3f( P040);
n3f( N039);
v3f( P039);
endpolygon();
}
fish004()
{
bgnpolygon();
n3f( N040);
v3f( P040);
n3f( N041);
v3f( P041);
n3f( N051);
v3f( P051);
n3f( N050);
v3f( P050);
endpolygon();
bgnpolygon();
n3f( N041);
v3f( P041);
n3f( N042);
v3f( P042);
n3f( N052);
v3f( P052);
n3f( N051);
v3f( P051);
endpolygon();
bgnpolygon();
n3f( N042);
v3f( P042);
n3f( N033);
v3f( P033);
n3f( N043);
v3f( P043);
n3f( N052);
v3f( P052);
endpolygon();
bgnpolygon();
n3f( N033);
v3f( P033);
n3f( N034);
v3f( P034);
n3f( N044);
v3f( P044);
n3f( N043);
v3f( P043);
endpolygon();
bgnpolygon();
n3f( N034);
v3f( P034);
n3f( N035);
v3f( P035);
n3f( N045);
v3f( P045);
n3f( N044);
v3f( P044);
endpolygon();
bgnpolygon();
n3f( N035);
v3f( P035);
n3f( N036);
v3f( P036);
n3f( N046);
v3f( P046);
n3f( N045);
v3f( P045);
endpolygon();
bgnpolygon();
n3f( N036);
v3f( P036);
n3f( N037);
v3f( P037);
n3f( N047);
v3f( P047);
n3f( N046);
v3f( P046);
endpolygon();
bgnpolygon();
n3f( N037);
v3f( P037);
n3f( N038);
v3f( P038);
n3f( N048);
v3f( P048);
n3f( N047);
v3f( P047);
endpolygon();
bgnpolygon();
n3f( N038);
v3f( P038);
n3f( N039);
v3f( P039);
n3f( N049);
v3f( P049);
n3f( N048);
v3f( P048);
endpolygon();
bgnpolygon();
n3f( N039);
v3f( P039);
n3f( N040);
v3f( P040);
n3f( N050);
v3f( P050);
n3f( N049);
v3f( P049);
endpolygon();
bgnpolygon();
n3f( N070);
v3f( P070);
n3f( N061);
v3f( P061);
n3f( N002);
v3f( P002);
endpolygon();
bgnpolygon();
n3f( N061);
v3f( P061);
n3f( N046);
v3f( P046);
n3f( N002);
v3f( P002);
endpolygon();
bgnpolygon();
n3f( N045);
v3f( P045);
n3f( N046);
v3f( P046);
n3f( N061);
v3f( P061);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N061);
v3f( P061);
n3f( N070);
v3f( P070);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N045);
v3f( P045);
n3f( N061);
v3f( P061);
endpolygon();
}
fish005()
{
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N044);
v3f( P044);
n3f( N045);
v3f( P045);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N043);
v3f( P043);
n3f( N044);
v3f( P044);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N052);
v3f( P052);
n3f( N043);
v3f( P043);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N051);
v3f( P051);
n3f( N052);
v3f( P052);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N046);
v3f( P046);
n3f( N047);
v3f( P047);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N047);
v3f( P047);
n3f( N048);
v3f( P048);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N048);
v3f( P048);
n3f( N049);
v3f( P049);
endpolygon();
bgnpolygon();
n3f( N002);
v3f( P002);
n3f( N049);
v3f( P049);
n3f( N050);
v3f( P050);
endpolygon();
bgnpolygon();
n3f( N050);
v3f( P050);
n3f( N051);
v3f( P051);
n3f( N069);
v3f( P069);
endpolygon();
bgnpolygon();
n3f( N051);
v3f( P051);
n3f( N002);
v3f( P002);
n3f( N069);
v3f( P069);
endpolygon();
bgnpolygon();
n3f( N050);
v3f( P050);
n3f( N069);
v3f( P069);
n3f( N002);
v3f( P002);
endpolygon();
}
fish006()
{
bgnpolygon();
n3f( N066);
v3f( P066);
n3f( N016);
v3f( P016);
n3f( N026);
v3f( P026);
endpolygon();
bgnpolygon();
n3f( N015);
v3f( P015);
n3f( N066);
v3f( P066);
n3f( N025);
v3f( P025);
endpolygon();
bgnpolygon();
n3f( N025);
v3f( P025);
n3f( N066);
v3f( P066);
n3f( N026);
v3f( P026);
endpolygon();
bgnpolygon();
n3f( N066);
v3f( P066);
n3f( N058);
v3f( P058);
n3f( N016);
v3f( P016);
endpolygon();
bgnpolygon();
n3f( N015);
v3f( P015);
n3f( N058);
v3f( P058);
n3f( N066);
v3f( P066);
endpolygon();
bgnpolygon();
n3f( N058);
v3f( P058);
n3f( N015);
v3f( P015);
n3f( N016);
v3f( P016);
endpolygon();
}
fish007()
{
bgnpolygon();
n3f( N062);
v3f( P062);
n3f( N022);
v3f( P022);
n3f( N032);
v3f( P032);
endpolygon();
bgnpolygon();
n3f( N062);
v3f( P062);
n3f( N032);
v3f( P032);
n3f( N064);
v3f( P064);
endpolygon();
bgnpolygon();
n3f( N022);
v3f( P022);
n3f( N062);
v3f( P062);
n3f( N032);
v3f( P032);
endpolygon();
bgnpolygon();
n3f( N062);
v3f( P062);
n3f( N064);
v3f( P064);
n3f( N032);
v3f( P032);
endpolygon();
}
fish008()
{
bgnpolygon();
n3f( N063);
v3f( P063);
n3f( N019);
v3f( P019);
n3f( N029);
v3f( P029);
endpolygon();
bgnpolygon();
n3f( N019);
v3f( P019);
n3f( N063);
v3f( P063);
n3f( N029);
v3f( P029);
endpolygon();
bgnpolygon();
n3f( N063);
v3f( P063);
n3f( N029);
v3f( P029);
n3f( N065);
v3f( P065);
endpolygon();
bgnpolygon();
n3f( N063);
v3f( P063);
n3f( N065);
v3f( P065);
n3f( N029);
v3f( P029);
endpolygon();
}
fish009()
{
lmbind(LMODEL,0);
cpack(0xFF000000);
bgnpolygon();
v3f( P059);
v3f( P012);
v3f( P009);
v3f( P060);
endpolygon();
bgnpolygon();
v3f( P012);
v3f( P004);
v3f( P007);
v3f( P009);
endpolygon();
lmbind(LMODEL,1);
}
fish_1()
{
fish004();
fish005();
fish003();
fish007();
fish006();
fish002();
fish008();
fish009();
fish001();
}
fish_2()
{
fish005();
fish004();
fish003();
fish008();
fish006();
fish002();
fish007();
fish009();
fish001();
}
fish_3()
{
fish005();
fish004();
fish007();
fish003();
fish002();
fish008();
fish009();
fish001();
fish006();
}
fish_4()
{
fish005();
fish004();
fish008();
fish003();
fish002();
fish007();
fish009();
fish001();
fish006();
}
fish_5()
{
fish009();
fish006();
fish007();
fish001();
fish002();
fish003();
fish008();
fish004();
fish005();
}
fish_6()
{
fish009();
fish006();
fish008();
fish001();
fish002();
fish007();
fish003();
fish004();
fish005();
}
fish_7()
{
fish009();
fish001();
fish007();
fish005();
fish002();
fish008();
fish003();
fish004();
fish006();
}
fish_8()
{
fish009();
fish008();
fish001();
fish002();
fish007();
fish003();
fish005();
fish004();
fish006();
}
int phi;
float seg1,seg2,seg3,seg4,segup;
draw_shark(struct fish *pfish)
{
int n;
Matrix MAT;
float thrash,chomp;
pfish->htail = (int)(pfish->htail - (int)(5. * pfish->v)) % 360;
thrash = 50. * pfish->v;
seg1 = .6 * thrash * fsin( pfish->htail * RRAD);
seg2 = 1.8 * thrash * fsin((pfish->htail + 45.) * RRAD);
seg3 = 3.0 * thrash * fsin((pfish->htail + 90.) * RRAD);
seg4 = 4.0 * thrash * fsin((pfish->htail + 110.) * RRAD);
if(pfish->v > 2.0) chomp = - (pfish->v - 2.0) * 200.0;
P004[1] = iP004[1] + chomp;
P007[1] = iP007[1] + chomp;
P010[1] = iP010[1] + chomp;
P011[1] = iP011[1] + chomp;
P023[0] = iP023[0] + seg1;
P024[0] = iP024[0] + seg1;
P025[0] = iP025[0] + seg1;
P026[0] = iP026[0] + seg1;
P027[0] = iP027[0] + seg1;
P028[0] = iP028[0] + seg1;
P029[0] = iP029[0] + seg1;
P030[0] = iP030[0] + seg1;
P031[0] = iP031[0] + seg1;
P032[0] = iP032[0] + seg1;
P033[0] = iP033[0] + seg2;
P034[0] = iP034[0] + seg2;
P035[0] = iP035[0] + seg2;
P036[0] = iP036[0] + seg2;
P037[0] = iP037[0] + seg2;
P038[0] = iP038[0] + seg2;
P039[0] = iP039[0] + seg2;
P040[0] = iP040[0] + seg2;
P041[0] = iP041[0] + seg2;
P042[0] = iP042[0] + seg2;
P043[0] = iP043[0] + seg3;
P044[0] = iP044[0] + seg3;
P045[0] = iP045[0] + seg3;
P046[0] = iP046[0] + seg3;
P047[0] = iP047[0] + seg3;
P048[0] = iP048[0] + seg3;
P049[0] = iP049[0] + seg3;
P050[0] = iP050[0] + seg3;
P051[0] = iP051[0] + seg3;
P052[0] = iP052[0] + seg3;
P002[0] = iP002[0] + seg4;
P061[0] = iP061[0] + seg4;
P069[0] = iP069[0] + seg4;
P070[0] = iP070[0] + seg4;
pfish->vtail += ((pfish->dtheta - pfish->vtail) * 0.1);
if (pfish->vtail > 0.5) pfish->vtail = 0.5;
else if (pfish->vtail < -0.5) pfish->vtail = -0.5;
segup = thrash * pfish->vtail;
P023[1] = iP023[1] + segup;
P024[1] = iP024[1] + segup;
P025[1] = iP025[1] + segup;
P026[1] = iP026[1] + segup;
P027[1] = iP027[1] + segup;
P028[1] = iP028[1] + segup;
P029[1] = iP029[1] + segup;
P030[1] = iP030[1] + segup;
P031[1] = iP031[1] + segup;
P032[1] = iP032[1] + segup;
P033[1] = iP033[1] + segup * 5.;
P034[1] = iP034[1] + segup * 5.;
P035[1] = iP035[1] + segup * 5.;
P036[1] = iP036[1] + segup * 5.;
P037[1] = iP037[1] + segup * 5.;
P038[1] = iP038[1] + segup * 5.;
P039[1] = iP039[1] + segup * 5.;
P040[1] = iP040[1] + segup * 5.;
P041[1] = iP041[1] + segup * 5.;
P042[1] = iP042[1] + segup * 5.;
P043[1] = iP043[1] + segup * 12.;
P044[1] = iP044[1] + segup * 12.;
P045[1] = iP045[1] + segup * 12.;
P046[1] = iP046[1] + segup * 12.;
P047[1] = iP047[1] + segup * 12.;
P048[1] = iP048[1] + segup * 12.;
P049[1] = iP049[1] + segup * 12.;
P050[1] = iP050[1] + segup * 12.;
P051[1] = iP051[1] + segup * 12.;
P052[1] = iP052[1] + segup * 12.;
P002[1] = iP002[1] + segup * 17.;
P061[1] = iP061[1] + segup * 17.;
P069[1] = iP069[1] + segup * 17.;
P070[1] = iP070[1] + segup * 17.;
pushmatrix();
translate(0.,0.,-3000.);
n = 0;
getmatrix(MAT);
if(MAT[0][2] >= 0.0) n += 1;
if(MAT[1][2] >= 0.0) n += 2;
if(MAT[2][2] >= 0.0) n += 4;
backface(1);
scale(2.0,1.0,1.0);
switch (n) {
case 0:
fish_1();
break;
case 1:
fish_2();
break;
case 2:
fish_3();
break;
case 3:
fish_4();
break;
case 4:
fish_5();
break;
case 5:
fish_6();
break;
case 6:
fish_7();
break;
case 7:
fish_8();
break;
default:
break;
}
backface(0);
popmatrix();
}